package org.example;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 唐加利
 * @date 2024/5/9
 */
@RestController
@RequestMapping("user")
public class UserController {

    private final UserService userService;

    private final DeptService deptService;

    public UserController(UserService userService, DeptService deptService) {
        this.userService = userService;
        this.deptService = deptService;
    }

    @GetMapping
    public Map<String, Object> detail() {
        Map<String, Object> map = new HashMap<>();
        map.put("user", userService.getUser());
        map.put("dept", deptService.getDept());
        return map;
    }
}
